import { reqGetCartList } from '@/api'

let state = {
  cartList: [{cartInfoList:[]}]
}

let mutations = {
  GETCARTLIST(state, data) {
    state.cartList = data
  }
}

let actions = {
  async getCartList({ commit }) {
    let result = await reqGetCartList()
    if (result.code == 200) {
      commit('GETCARTLIST', result.data)
    }
  }
}

let getters = {}

export default {
  state,
  mutations,
  actions,
  getters
}
